package com.example.tired1.zyfypt_0131shiyining;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class LoginActivity extends AppCompatActivity {
    private Button loginButton;
    private  Button registerButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);




        loginButton= (Button) findViewById(R.id.button_login);
        registerButton= (Button) findViewById(R.id.button2_register);
            registerButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
          /*      //启动无返回的Activity
                Intent intent=new Intent();
                intent.setClass(MainActivity.this,RegisterActivity.class);
                startActivity(intent);
                有结果的
*/
                Intent intent = new Intent(LoginActivity.this, RegisterActivity.class);
                startActivityForResult(intent, 1);


            }
        });
        loginButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent();
                intent.setClass(LoginActivity.this,MainActivity.class);
                startActivity(intent);
            }
        });





    }
}
